<form nz-form [formGroup]="validateForm">

  <nz-form-item>
    <nz-form-label [nzSm]="4" [nzXs]="24" nzRequired nzFor="productId">产品</nz-form-label>
    <nz-form-control [nzSm]="16" [nzXs]="24">
      <nz-select [formControlName]="'productId'" nzShowSearch (ngModelChange)="productChange($event)">
        <nz-option nzValue="" nzLabel="请选择"></nz-option>
        <nz-option [nzValue]="p.pid" [nzLabel]="p.productName" *ngFor="let p of allProducts"></nz-option>
      </nz-select>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-control [nzSpan]="8" [nzOffset]="4">
      <label nz-checkbox formControlName="required" (ngModelChange)="requiredChange($event)">是否包含项目sql</label>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item *ngIf="validateForm.get('required').value">
    <nz-form-label [nzSm]="4" [nzXs]="24" nzRequired nzFor="productId">项目</nz-form-label>
    <nz-form-control [nzSm]="16" [nzXs]="24">
      <nz-select [formControlName]="'projectId'" nzShowSearch>
        <nz-option nzValue="" nzLabel="请选择"></nz-option>
        <nz-option [nzValue]="p.pid" [nzLabel]="p.projectName" *ngFor="let p of projects"></nz-option>
      </nz-select>
    </nz-form-control>
  </nz-form-item>
</form>
<div nz-row>
  <div nz-col [nzSm]="4" [nzXs]="24" class="label">从</div>
  <div nz-col [nzSm]="8" [nzXs]="24">
    <nz-input-number [(ngModel)]="start" [nzMin]="1" [nzMax]="startMax()"></nz-input-number>
  </div>
</div>
<div nz-row>
  <div nz-col [nzSm]="4" [nzXs]="24" class="label">到</div>
  <div nz-col [nzSm]="8" [nzXs]="24">
    <nz-input-number [(ngModel)]="end" [nzMin]="endMin()"></nz-input-number>
  </div>
</div>

<div nz-row>
  <div nz-col [nzSm]="4" [nzXs]="24"></div>
  <div nz-col [nzSm]="16" [nzXs]="24">
    <a nz-button [disabled]="!validateForm.valid" [href]="exportUrl()" target="_blank" nzType="primary">导出</a>
  </div>
</div>
